# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=zlib
pkgver=1.3.1
pkgrel=1
pkgdesc="A compression/decompression Library"
arch="all"
license="Zlib"
url="https://zlib.net/"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://zlib.net/fossils/zlib-$pkgver.tar.gz
	"

# secfixes:
#   1.2.12-r2:
#     - CVE-2022-37434
#   1.2.11-r4:
#     - CVE-2018-25032
#   0:
#     - CVE-2023-45853
#     - CVE-2023-6992

build() {
	# we trade size for a little more speed.
	export CFLAGS="$CFLAGS -O2"
	CHOST="$CHOST" ./configure \
		--prefix=/usr \
		--libdir=/lib \
		--shared
	make
}

check() {
	make check
}

package() {
	make install \
		pkgconfigdir="/usr/lib/pkgconfig" \
		DESTDIR="$pkgdir"
}

sha512sums="
580677aad97093829090d4b605ac81c50327e74a6c2de0b85dd2e8525553f3ddde17556ea46f8f007f89e435493c9a20bc997d1ef1c1c2c23274528e3c46b94f  zlib-1.3.1.tar.gz
"
